package com.zzy.ecommerce.service.impl;

import com.zzy.ecommerce.dao.TUserMapper;
import com.zzy.ecommerce.domain.TUser;
import com.zzy.ecommerce.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Autowired
    private TUserMapper tUserMapper;
    @Override
    public Integer selectOneUser(String username, String password) {
        return tUserMapper.selectOneUser(username, password);
    }

    @Override
    public Integer insertOneUser(TUser tUser) {

        return tUserMapper.insert(tUser);
    }

    @Override
    public Integer deleteAllUsers() {
        return tUserMapper.deleteAllUsers();
    }

    @Override
    public TUser selectOneUserByUserName(String username) {
        return tUserMapper.selectOneUserByUserName(username);
    }

    @Override
    public TUser selectOneUserById(Integer userid) {
        return tUserMapper.selectOneUserById(userid);
    }

    @Override
    public Integer updateAccount(String password, Integer id) {
        return tUserMapper.updateAccount(password, id);
    }
}
